package com.xiaoming.service;

import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.stereotype.Component;

@Component
public class ConsumerService {
    @Reference
    private MethodService methodService;

    public void doAction(){
        RpcContext.getContext().setAttachment("methodName","methodA");
        String resa = methodService.methodA();
        System.out.println(resa);

        RpcContext.getContext().setAttachment("methodName","methodB");
        String resb = methodService.methodB();
        System.out.println(resb);

        RpcContext.getContext().setAttachment("methodName","methodC");
        String resc = methodService.methodC();
        System.out.println(resc);
    }
}
